<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
<h1>修改</h1>
    <input v-model="product.id" placeholder="商品id">
    <input v-model="product.title" placeholder="商品名称">
    <input v-model="product.price" placeholder="价格">
    <input v-model="product.num" placeholder="库存">
    <input type="button" value="修改" @click="update()">
    <a href="/select">查询</a>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
   <script src=" https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
     <script>
       let v=new Vue({
         el:"body>div",
         data:{
             product:{title:"",price:"",num:""}
         },
         methods:{
             update(){
                 axios.post("/update",v.product).then(function (rsp) {
                     alert(rsp.data)
                 })
             }

         }
       })

     </script>
</body>
</html>